//
//  XHQBaseLabel.m
//  XiongMaoJiaSu
//
//  Created by 徐汉卿 on 16/5/25.
//  Copyright © 2016年 ISOYasser. All rights reserved.
//

#import "XHQBaseLabel.h"

@implementation XHQBaseLabel

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/


-(instancetype)init
{
    
    
    if (self = [super init]) {
        self.textColor = kMainColorText;
        self.font = kMainFont(14);
        self.numberOfLines = 0;
//        self.backgroundColor = [UIColor greenColor];
          self.insets = UIEdgeInsetsMake(0.0f, 0.0f, 0.0f, 0.0f);
    }
    return self;
}



//- (void)setText:(NSString *)text
//{
//    
//    
//    CGFloat width;
//    if (self.frame.size.width < 0.1) {
//        width = kScreenWidth;
//    }else{
//        width = self.frame.size.width;
//    }
//    CGSize size = [text sizeWithFont:self.font constrainedToSize:CGSizeMake(width, CGFLOAT_MAX)];
//    CGAffineTransform transform = self.transform;
//    self.transform = CGAffineTransformIdentity;
//    CGRect frame = self.frame;
//    frame.size.height = size.height;
//    self.frame = frame;
//    self.transform = transform;
//    
//    [super setText:text];
//}

-(void)drawTextInRect:(CGRect)rect
{
    UIEdgeInsets insets = _insets;
    
    [super drawTextInRect:UIEdgeInsetsInsetRect(rect, insets)];
    
}

@end
